import { getLocalToken, removeLocalToken, setLocalToken } from '@/utils/storage'
export default {
  state: {
    tokenInfo: getLocalToken() || {}
  },
  mutations: {
    changeToken(state, val) {
      state.tokenInfo = val
      setLocalToken(val)
    },
    removeToken(state) {
      state.tokenInfo = {}
      removeLocalToken()
    }
  },
  namespaced: true
}
